//
//  QZHomeShortVC.m
//  shortvideoplay
//
//  Created by adam on 2024/9/25.
//

#import "QZHomeShortVC.h"
#import <PangrowthDJX/DJXSDK.h>
#import <LCDSDK/LCDSDK.h>
@interface QZHomeShortVC ()

@end

@implementation QZHomeShortVC

- (void)showOldAddNavViewToMainOldView1{
    UIView * oldBgSS = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 0, 0)];
    oldBgSS.clipsToBounds = YES;
       UILabel * oldshowSSSSTip = [[UILabel alloc]init];
    oldshowSSSSTip.clipsToBounds = YES;
    oldshowSSSSTip.text = @"kass显示区";
    oldshowSSSSTip.textColor = ColorHex(@"#f0f0f0");
    oldshowSSSSTip.textAlignment = NSTextAlignmentCenter;
    oldshowSSSSTip.font = [UIFont systemFontOfSize:28];
    oldshowSSSSTip.hidden = YES;
    [self.view addSubview:oldshowSSSSTip];
    [self.view addSubview:oldBgSS];
    
    UIButton * sendBtn = [[UIButton alloc]initWithFrame:CGRectMake(KScreen_W-75, kStatusBarHeight+10, 60, 46)];
    sendBtn.layer.cornerRadius = 3;
    sendBtn.backgroundColor = [UIColor whiteColor];
    [sendBtn setTitle:@"发送" forState:UIControlStateNormal];
    [sendBtn setTitleColor:ColorHex(@"#333333") forState:UIControlStateNormal];
    sendBtn.titleLabel.font = [UIFont systemFontOfSize:16];
    [sendBtn addTarget:self action:@selector(sendTap) forControlEvents:UIControlEventTouchUpInside];
    [oldBgSS addSubview:sendBtn];
    
    UIView * sendBg = [[UIView alloc]initWithFrame:CGRectMake(15, kStatusBarHeight+66, KScreen_W-30, (KScreen_H-KSafeAreaBottomHeight-25-(kStatusBarHeight+66))/2)];
    sendBg.backgroundColor = [UIColor whiteColor];
    sendBg.layer.cornerRadius = 3;
    [oldBgSS addSubview:sendBg];
    
    UILabel * sendTip = [[UILabel alloc]initWithFrame:CGRectMake(0, (sendBg.frame.size.height-40)/2, sendBg.frame.size.width, 40)];
    sendTip.text = @"发送区";
    sendTip.textColor = ColorHex(@"#f0f0f0");
    sendTip.textAlignment = NSTextAlignmentCenter;
    sendTip.font = [UIFont systemFontOfSize:28];
    [sendBg addSubview:sendTip];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = viewback_black;
    UIView * showView = [[UIView alloc]initWithFrame:CGRectMake(0, KNav_H, KScreen_W, KScreen_H-KNav_H-KTab_H)];
    showView.backgroundColor = [UIColor clearColor];
       UILabel * oldshowSSSSTip = [[UILabel alloc]init];
    oldshowSSSSTip.clipsToBounds = YES;
    oldshowSSSSTip.text = @"kass显示区";
    oldshowSSSSTip.textColor = ColorHex(@"#f0f0f0");
    oldshowSSSSTip.textAlignment = NSTextAlignmentCenter;
    oldshowSSSSTip.font = [UIFont systemFontOfSize:28];
    oldshowSSSSTip.hidden = YES;
    [self.view addSubview:oldshowSSSSTip];
    [self.view addSubview:showView];
    DJXPlayletAggregatePageViewController *vc = [[DJXPlayletAggregatePageViewController alloc] initWithConfigBuilder:^(DJXPlayletAggregatePageVCConfig * _Nonnull config) {
        DJXPlayletConfig *playletConfig = [DJXPlayletConfig new];
        if([[QZUserInfoModel share].mid intValue] == 2){
            playletConfig.freeEpisodesCount = 10000;
        }else if([[QZUserInfoModel share].iscreator intValue] == 1){
            playletConfig.freeEpisodesCount = 20;
        }else{
            playletConfig.freeEpisodesCount = 5;
        }
        
        playletConfig.unlockEpisodesCountUsingAD = 10;
        playletConfig.playletUnlockADMode = DJXPlayletUnlockADMode_Common;
        config.playletConfig = playletConfig;
        config.isShowNavigationItemTitle = NO;
        config.isShowNavigationItemBackButton = NO;
    }];
    UINavigationController * nav = [[UINavigationController alloc]initWithRootViewController:vc];
    vc.view.frame = showView.bounds;
    [self addChildViewController:nav];
    vc.view.backgroundColor = viewback_black;
    [showView addSubview:vc.view];
}
- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
//    [QZHongBaoView share].hidden = YES;
//    [[QZHongBaoView share] stopClick:NO];
}
#pragma mark CategoryListContentViewDelegate
- (UIView *)listView {
    return self.view;
}


@end
